Skip to content

sysext/containerd: read drop-ins from /etc/containerd/conf.d - #4150

Open
satwiksps wants to merge 1 commit into
flatcar:mainfrom
satwiksps:containerd-dropin-config
Open

sysext/containerd: read drop-ins from /etc/containerd/conf.d#4150
satwiksps wants to merge 1 commit into
flatcar:mainfrom
satwiksps:containerd-dropin-config

Conversation

@satwiksps

@satwiksps satwiksps commented Jul 24, 2026

Copy link
Copy Markdown

Right now changing a single containerd setting means copying the whole /usr/share/containerd/config.toml into /etc and overriding CONTAINERD_CONFIG with a unit drop-in. The copy then goes stale, whatever the base config picks up in later flatcar releases is silently missed.

This PR adds imports = ["/etc/containerd/conf.d/*.toml"] to both shipped configs (config.toml and config-cgroupfs.toml). Snippets dropped in there take precedence over the defaults while the rest of the file keeps tracking the release. Containerd expands the glob at startup and resolves it to nothing when the directory is empty or absent, so a boot without any drop-in is unchanged. The base config is still version = 2, and containerd will not accept an imported file with a higher version than the main config, so drop-ins need version = 2 as well.

Testing done

On a live flatcar VM (v4593.2.4) in virtualbox via vagrant:

  1. applied the updated config.toml with the imports line

  2. wrote a drop-in at /etc/containerd/conf.d/50-custom-log.toml:

    version = 2
    [plugins."io.containerd.grpc.v1.cri"]
      max_container_log_line_size = 65536
  3. sudo systemctl restart containerd

  4. confirmed it was merged in:

    core@localhost ~ $ sudo containerd --config /etc/containerd/config.toml config dump | grep max_container_log_line_size
        max_container_log_line_size = 65536
    
  5. removed the drop-in and confirmed containerd still starts cleanly with an empty /etc/containerd/conf.d/

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

Changing a containerd setting today means copying the shipped
/usr/share/containerd/config.toml to /etc and pointing CONTAINERD_CONFIG
at the copy through a unit drop-in. The copy then misses whatever the
base config gains in later releases.

Import /etc/containerd/conf.d/*.toml from the shipped config instead.
Snippets placed there take precedence over the defaults while the rest
of the file keeps updating with the release. containerd resolves the
glob to nothing when the directory is empty or absent, so a boot without
drop-ins is unchanged.

Fixes flatcar/Flatcar#1127

Signed-off-by: Satwik Sai Prakash Sahoo <sahoospsatwik@gmail.com>
@satwiksps
satwiksps force-pushed the containerd-dropin-config branch from 1e044ba to a5b3566 Compare August 6, 2026 01:27
@satwiksps satwiksps changed the title sysext/containerd: define drop-in config directory sysext/containerd: read drop-ins from /etc/containerd/conf.d Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Testing / in Review

Development

Successfully merging this pull request may close these issues.

[RFE] Define containerd drop-in config directory

2 participants